import Vue from 'vue'
import VueRouter from 'vue-router'
import NewPaper from "../views/NewPaper";//上传题库
import AllQuestionBank from "../views/AllQuestionBank";//所有题库
import testPaperGeneration from "../views/testPaperGeneration";//生成试卷
import ViewTestPaper from "../views/ViewTestPaper";//查看试卷
import homepage from "../views/homepage";//主页
import classMana from "../views/classMana";//班级管理
import parManag from "../views/parManag";//学员管理
import Examination from "../views/Examination";//考试
import grades from "../views/Grades";//成绩
import Score from "../views/Score";//评分
import Personal from "../views/Personal";//个人中心
import Index from "../views/Index";
Vue.use(VueRouter)

const routes = [
    {
        path: '/',
        name: 'login',
        component: () => import('../views/LoginView.vue')
    },
    {
        path: '/register',
        name: 'register',
        component: () => import('../views/RegisterView.vue')
    },
    {
        path: "/index",
        name: "班级管理",
        component: Index,
        redirect: "/homepage",
        children: [
            {
                path: "/homepage",
                name: "主页",
                component: homepage
            },
            {
                path: "/classMana",
                name: "班级管理",
                component: classMana
            },
            {
                path: "/parManag",
                name: "学员管理",
                component: parManag
            },
            {
                path: "/Personal",
                name: "个人中心",
                component: Personal
            }
        ]
    },
    {
        path: "/",
        name: "考试管理",
        component: Index,
        children: [
            {
                path: "/NewPaper",
                name: "上传题库",
                component: NewPaper
            },
            {
                path: "/AllQuestionBank",
                name: "所有题库",
                component: AllQuestionBank
            },

            {
                path: "/testPaperGeneration",
                name: "生成试卷",
                component: testPaperGeneration
            },
            {
                path: "/ViewTestPaper",
                name: "查看试卷",
                component: ViewTestPaper
            },
            {
                path: "/Examination",
                name: "考试",
                component: Examination
            }, {
                path: "/Grades",
                name: "成绩",
                component: grades
            }
            , {
                path: "/Score",
                name: "评分",
                component: Score
            }
        ]
    }
]

const routers = [
    {
        path: "/",
        name: "班级管理",
        component: Index,
        redirect: "/homepage",
        children: [
            {
                path: "/homepage",
                name: "主页",
                component: homepage
            },
            {
                path: "/classMana",
                name: "班级管理",
                component: classMana
            },
            {
                path: "/parManag",
                name: "学员管理",
                component: parManag
            }
        ]
    },
    {
        path: "/",
        name: "考试管理",
        component: Index,
        children: [
            {
                path: "/NewPaper",
                name: "上传题库",
                component: NewPaper
            },
            {
                path: "/AllQuestionBank",
                name: "所有题库",
                component: AllQuestionBank
            },
            {
                path: "/testPaperGeneration",
                name: "生成试卷",
                component: testPaperGeneration
            },
            {
                path: "/ViewTestPaper",
                name: "查看试卷",
                component: ViewTestPaper
            }, {
                path: "/Examination",
                name: "考试",
                component: Examination
            }, {
                path: "/Grades",
                name: "成绩",
                component: grades
            },
            {
                path: "/Score",
                name: "评分",
                component: Score
            },
            // {
            //     path: '/Scoring',
            //     name: "评分详情",
            //     component: () => import('../components/score/Scoringdetails.vue')
            // }
        ]
    },
    // {
    //     path: "/",
    //     name: "个人中心",
    //     component: Personal,
    //     children: [
    //         {
    //             path: "/Personal",
    //             name: "个人中心",
    //             component: Personal
    //         }
    //     ]
    // }
]

const router = new VueRouter({
    mode: 'history',
    base: process.env.BASE_URL,
    routers,
    routes
})

export default router